package hardwareToSQL;


public class SensorData {
	/**The default value for name */
	public final static String DEFAULT="Default"; 
	/**The name of the value of the data sent */
	private String name;
	/**The value of the data itself */
	private int value;
	/**The unit of the value */
	private String unit;
	
	/**Class constructor */
	public SensorData(String name, int value, String unit){

		this.name = name;
		this.value = value;
		this.unit = unit;

	}

	/**Update values for this object */
	public void update(String name, int value, String unit){
		this.name = name;
		this.value = value;  
		this.unit = unit;
	}

	/**Return the name of the data */
	public String getName(){
		return name;
	}

	/**Return the corresponding unit */
	public String getUnit(){
		return unit;
	}
	
	/**Return the corresponding value */
	public int getValue(){
		return value;
	}
	/**
	 * @return true if the Sensor is default
	 */
	public boolean isDefault(){
		return this.name == SensorData.DEFAULT;
	}

}
